

import express from 'express';
import db from './../../lib/dbHelper';

let adminRouter=express.Router();

adminRouter.use("/index",(request,response,next)=>{


    let muenSQL = "SELECT*FROM `menu` WHERE m_flag=1 ORDER BY m_orderby ";

    let webSQL = "SELECT*FROM `websiteinfo` ";

    db.query(webSQL, [], function (err, res1) {
        console.log(res1);

        db.query(muenSQL, [], function (err, res2) {
            response.render("./admin/index.html", {
                menu: res2,
                webinfo: res1
            });
        })


    })



})

module.exports=adminRouter;

